When storing data in a flash memory system, the data can be stored so that the data appears to be random with a uniform distribution. Randomization of stored data may be advantageous to avoid a correlation between data on adjacent word lines or between data on adjacent bit lines. For example, data to be stored in a non-volatile memory may be scrambled in order to avoid creating a correlation between data on adjacent word lines and in order to avoid a correlation between data on adjacent bit lines of the non-volatile memory. Data that has been scrambled prior to storage can be de-scrambled upon retrieval.
Scrambling of data can be performed by generating a string of bits that can be used as a pseudo-random scrambling word, such as a string of random bits, and then performing an exclusive-OR (XOR) operation of the data with the pseudo-random scrambling word to generate scrambled data. For example, the pseudo-random scrambling word can be generated by applying a seed to a pseudo-random bit generator. The seed may also be used to re-create the pseudo-random scrambling word to descramble the scrambled data. However, storage of the pseudo-random scrambling word or the seed with the data can result in inefficiencies in use of storage space within the non-volatile memory.
Typically, a programming unit of the flash memory system is a page. The page typically has a size of 16 kilobytes (KB). Scrambling of the data stored in the flash memory system may be done on a page level in order to avoid data-dependent errors. However, during a read operation it may be desirable to retrieve data in increments smaller than one page. For example, a host may request to retrieve a small amount of data, such as a single sector of 512 B, and although within the flash memory system an entire page of 16 kB may be read, it may be inefficient to transfer and decode the entire page. Instead, it may be preferable to encode the data of the page within several smaller codewords so that during a read of the flash memory system it is possible to transfer and decode only a single codeword that includes the requested data, the codeword having a size such as 0.5 KB, 1 KB, or 2 KB.
This leads to two competing factors in seed storage and protection. On the one hand, since scrambling may be required on a page level, it would be desirable to have a single scrambling seed stored (reliably with error correction coding (ECC) protection) per page in order to avoid wasting storage area. On the other hand, in order to allow efficient reading of a small amount of data, it would be desirable to retrieve an error-free version of the seed with each codeword in order to descramble the data after decoding.